package general;

public class Source
{
	private static int	idf = 0;

	public double anglePhi;

	public double	angleTheta;

	public Source( Case case1 )
	{
		double rho = Math.sqrt( Math.pow(case1.zone.p1.sx, 2) + Math.pow(case1.zone.p1.sy, 2) + Math.pow(case1.zone.p1.sz, 2));
		double den = Math.sqrt( Math.pow(case1.zone.p1.sx, 2) + Math.pow(case1.zone.p1.sy, 2) );
		anglePhi = Math.acos( case1.zone.p1.sz/rho );
		
		//System.out.println("den : " + den + " x " + case1.zone.p1.sx + " r " + Math.acos( case1.zone.p1.sx / den ));
		if( case1.zone.p1.sy >= 0 )
			angleTheta = Math.acos( case1.zone.p1.sx / den );
		else
			angleTheta = 2 * Math.PI - Math.acos( case1.zone.p1.sx / den );
	}

	public static int getIDF()
	{
		idf ++;
		return idf;
	}
}
